[php]一条sql语句不太理解,请教

来源:百度知道 编辑:UC知道 时间:2024/05/29 16:13:24
/*
updateSql 修改SQL语句生成函数
$tableName 表名
$array 对应表单数据数组
$id 对表的ID号字段名
*/

$sql="select * from ".$tableName." where ".$id."=0"
为什么用".$tableName." 表达,而且$id."=0"???
还是不太明白

这不是字符串连接么 $tableName 表名么
最后连接成的sql语句就是 select * from 表名 where 字段名 = 0

要在指定名字的表中搜索id号等于0的数据

要在$tableName表中搜索ID是0的条目。多看书